.knowledge-base-resource-list-container {
  height: 100%;

  .source-detail-list-search-container {
    box-sizing: border-box;
    margin-bottom: 12px;

    .knowledge-base-directory-search-container-inner {
      display: flex;
      align-items: center;

      .add-resource-btn {
        flex-shrink: 0;
        margin-left: 12px;
      }

      .knowledge-base-directory-search {
        .arco-input-inner-wrapper {
          border-radius: 8px;
        }

        .arco-input {
          font-size: 12px;
        }
      }
    }
  }

  .add-resource-btn {
    width: 32px;
    height: 32px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 8px;
    border: solid 1px rgba(0, 0, 0, 0.11);
    cursor: pointer;
  }
  .add-resource-btn:hover {
    background: #eeeeee;
  }

  .knowledge-base-resource-list-container-small {
    padding: 0 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }

  .knowledge-base-directory-search-container {
    padding: 12px 12px 0 12px;
    height: 84px;
    box-sizing: border-box;

    .knowledge-base-directory-search-container-inner {
      display: flex;
      align-items: center;

      .add-resource-btn {
        flex-shrink: 0;
        margin-left: 12px;
      }

      .knowledge-base-directory-search {
        .arco-input-inner-wrapper {
          border-radius: 8px;
        }

        .arco-input {
          font-size: 12px;
        }
      }
    }
  }

  .source-detail-inner-list {
    height: calc(100% - 84px);
    overflow-y: auto;
    min-width: 200px;
    overflow-x: auto;

    .resource-utility-info {
      margin-top: 8px;
      color: rgba(0, 0, 0, 0.6);
      font-size: 12px;
    }
  }
}

.source-detail-item {
  position: relative;
  padding: 12px;
  margin-bottom: 8px;
  border-radius: 8px;
  &--selected {
    background-color: #f1f1f0;
  }

  &:hover {
    background-color: #f1f1f0;
    cursor: pointer;

    .knowledge-base-directory-action {
      margin-bottom: 8px;

      .action-summary {
        background-color: #dddddb;
      }

      .action-markdown-content,
      .action-external-origin-website {
        background-color: #dddddb;
      }
    }
  }
  .delete-button {
    margin-right: -12px;
  }

  .knowledge-base-directory-site-intro {
    display: flex;
    flex-direction: row;

    .site-intro-content {
      font-size: 10px;
      color: rgba(0, 0, 0, 0.6);

      p,
      a {
        display: inline-block;
        width: 100%;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
      }

      a {
        &:hover {
          color: #0E9F77;
        }
      }
    }
  }

  .knowledge-base-directory-title {
    font-size: 14px;
    font-weight: 500;
    color: rgba(0, 0, 0, 0.8);
    margin-top: 8px;
  }

  .knowledge-base-directory-action {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    font-size: 10px;
    margin-bottom: 8px;

    .action-summary {
      display: flex;
      flex-direction: row;
      align-items: center;
      padding: 0 8px;
      border-radius: 999px;
      height: 24px;
      background-color: #f1f1f0;
      font-weight: 500;
    }

    .action-markdown-content,
    .action-external-origin-website {
      width: 24px;
      height: 24px;
      display: flex;
      flex-direction: row;
      align-items: center;
      justify-content: center;
      border-radius: 999px;
      background-color: #f1f1f0;

      &:hover {
        background-color: #000;
        color: #fff;
      }

      &.active {
        background-color: #000;
        color: #fff;
      }
    }
  }

  .site-intro-content {
    width: calc(100% - 60px);
    margin-left: 8px;
  }

  .site-intro-icon {
    img {
      border-radius: 8px;
      width: 32px;
      height: 32px;
    }
  }

  .knowledge-base-directory-keyword-list {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 8px;
    gap: 8px;

    .knowledge-base-directory-keyword-item {
      padding: 0px 8px;
      height: 24px;
      border-radius: 999999px;

      border: 1px solid rgba(0, 0, 0, 0.1);

      span {
        font-size: 10px;
        color: rgba(0, 0, 0, 0.8);
      }
    }
  }
}

.search-result-popover-content {
  width: 400px;
  max-height: 500px;
  display: flex;
  flex-direction: column;

  h4 {
    margin: 0;
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 16px;
    font-weight: 500;
  }

  .content-body {
    padding: 16px;
    padding-top: 0;
    overflow-y: auto;
    max-height: 452px; // 500px - header height
    line-height: 1.6;
    color: #333;
    font-size: 14px;
    white-space: pre-wrap;
    word-break: break-word;

    &::-webkit-scrollbar {
      width: 6px;
    }

    &::-webkit-scrollbar-thumb {
      background-color: #ccc;
      border-radius: 3px;
    }

    &::-webkit-scrollbar-track {
      background-color: #f5f5f5;
    }
  }
}
